home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / basic / qbware.exe / BARMENU.BAS < prev    next >
BASIC Source File  |  1990-11-30  |  2KB  |  85 lines

  1. DECLARE SUB BarMenu (MenuList$(), Tr%, Fg%, Bg%, Snow%, RtnItm%)
  2. '*****************************************************************************
  3. '
  4. '   BarMenu.Bas
  5. '
  6. '*****************************************************************************
  7.  
  8. 'Copyright (c) 1988 Marcel Madonna
  9.  
  10. 'BARMENU.BAS shows the use of a simple LOTUS-like bar menu
  11. '  with QBWARE.
  12. '*****************************************************************************
  13.  
  14.  
  15.     OPTION BASE 1
  16.  
  17.  
  18. ' Set up housekeeping for window drivers
  19.  
  20.     Snow% = 1                       'Assume you will see no flicker
  21.                     'Change this value to 0 if the screen
  22.                     'flickers
  23.  
  24.  
  25.     RESTORE BarMenu.Txt             'Menu items
  26.  
  27.     READ Count%
  28.     REDIM MenuText$(Count%, 2)
  29.     x% = 1
  30.     READ MenuText$(1, 1)
  31.     READ MenuText$(1, 2)
  32.     WHILE MenuText$(x%, 1) <> "EOM" AND x% <= Count%
  33.         x% = x% + 1
  34.         READ MenuText$(x%, 1): READ MenuText$(x%, 2)
  35.     WEND
  36.     MenuText$(x%, 1) = ""
  37.  
  38.     Tr% = 1: Fg% = 15: Bg% = 1
  39.     CALL BarMenu(MenuText$(), Tr%, Fg%, Bg%, Snow%, Answer%)
  40.  
  41.     ON Answer% GOSUB Item1, Item2, Item3, Item4, Item5, Item6, Item7, Item8, Item9, Item10
  42.  
  43.  
  44.  
  45.     CLS
  46.     PRINT "You have exited without making a selection"
  47.     END
  48.  
  49. Item1:
  50. Item2:
  51. Item3:
  52. Item4:
  53. Item5:
  54. Item6:
  55. Item7:
  56. Item8:
  57. Item9:
  58. Item10:
  59.  
  60.     CLS
  61.     PRINT "You have selected item" + STR$(Answer%)
  62.     END
  63.  
  64.  
  65.  
  66. ' These are the menu choices.
  67.  
  68. BarMenu.Txt:
  69.     DATA 15
  70.     DATA "AItem","Item A description"
  71.     DATA "BItem","Item B description"
  72.     DATA "CItem","Item C description"
  73.     DATA "DItem","Item D description"
  74.     DATA "EItem","Item E description"
  75.     DATA "FItem","Item F description"
  76.     DATA "GItem","Item G description"
  77.     DATA "HItem","Item H description"
  78.     DATA "IItem","Item I description"
  79.     DATA "JItem","Item J description"
  80.     DATA "EOM","Dummy"
  81.  
  82.     END
  83.                               
  84.  
  85.